fix(generic): escape SQL identifiers and literals in metadata/DDL paths (#1914) - #2199
Merged
Merged
Conversation
…maintainer review (OtterMind#1914) - new GenericIdentifierProcessor (SPI ISQLIdentifierProcessor): quoteIdentifier with double-quote default + dialect-parameterized char variant, escapeString with single-quote doubling - GenericMetaData overrides getSQLIdentifierProcessor() - template-aware validation moved to GenericSqlGuards (sanitizeTemplateValue, requireSafeIdentifier AS-IS), escaping delegated to the processor - GenericSqlEscapes removed; tests migrated (12 green)
…ote for DDL paths (OtterMind#1914)
openai0229
force-pushed
the
fix/sqli2-generic
branch
from
July 29, 2026 12:23
dc15633 to
775911d
Compare
openai0229
approved these changes
Jul 29, 2026
openai0229
left a comment
Contributor
There was a problem hiding this comment.
Maintainer review complete: Generic template values are context-aware, JDBC fallback arguments remain raw, the identifier processor satisfies the shared always-quote round-trip contract, and the 13-module clean reactor passed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Related issue
Closes #1914
Summary
GenericIdentifierProcessorfor SPI consumers, keeping ordinaryquoteIdentifierconditional while implementing unconditional, delimiter-safequoteIdentifierAlwayswith exact quote/remove round-trip behavior.Affected surfaces
Verification
mvn -B -f chat2db-community-server/pom.xml -pl chat2db-community-plugins/chat2db-community-generic -am clean test -Dmaven.test.skip=false -DskipTests=false -Dmaven.test.failure.ignore=falseBUILD SUCCESS; tools 26/26, SPI 90/90, MySQL 653/653, PostgreSQL 49/49, DuckDB 2/2, TDengine 1/1, Generic 15/15; zero failures, errors, or skipped tests in these modules. Elasticsearch and domain-api compiled successfully and contain no tests in this reactor.git diff --check origin/main...HEADRisk and compatibility
[A-Za-z0-9_$]+because Generic cannot safely infer a dialect delimiter there.Reviewer map
chat2db-community-server/chat2db-community-plugins/chat2db-community-generic/src/main/java/ai/chat2db/plugin/generic/GenericSqlGuards.java, thenGenericMetaData.java,GenericDBManager.java, andidentifier/GenericIdentifierProcessor.java.removeIdentifierQuote(quoteIdentifierAlways(raw)).equals(raw).Contributor declaration
AI assistance: Maintainer used AI-assisted code review and test development; all resulting changes were source-reviewed and verified with the clean Maven reactor reported above.